<template>
  <el-dialog
    v-model="visible"
    :title="title"
    destroy-on-close
    :close-on-click-modal="false"
    class="submit-dialog"
  >
    <slot />
    <template #footer>
      <el-button
        @click="visible=false"
      >
        取消
      </el-button>
      <el-button
        type="primary"
        @click="emit('submit')"
      >
        {{ submitText }}
      </el-button>
    </template>
  </el-dialog>
</template>
<script setup>
import {ref} from 'vue'
const props = defineProps({
    title:{
        type:String,
        default:'新增'
    },
    submitText:{
        type:String,
        default:'提交'
    }
})

const visible = ref(props.visible)
const emit =defineEmits(['submit'])

defineExpose({
    visible
})



</script>

<style lang="scss">


.submit-dialog {
  .el-dialog__body{
  padding: 24px 36px;
}
.el-dialog__header{
  margin: 0 24px; 
  border-bottom: 1px solid #eee;
  padding-left:0;
  padding-right: 0;

}
}


</style>